%% it produces Figure 12 and O7
[mm,index_max_base]=max(W_mat(1,:,4));
figure(100)
plot(100*(1-k_vec),100*1/cons_ss*(W_mat(1,1:length(k_vec),5))-100*1/cons_ss*W_mat(1,1,4),':r','Linewidth',6),hold on
plot(100*(1-k_vec),100*1/cons_ss*(W_mat(1,1:length(k_vec),1))-100*1/cons_ss*W_mat(1,1,4),'--g','Linewidth',6),hold on
plot(100*(1-k_vec),100*1/cons_ss*(W_mat(1,1:length(k_vec),2))-100*1/cons_ss*W_mat(1,1,4),'-.k','Linewidth',6),hold on
plot(100*(1-k_vec),100*1/cons_ss*(W_mat(1,1:length(k_vec),4))-100*1/cons_ss*W_mat(1,1,4),'-b','Linewidth',6),hold off
yline(0,'--k','Status quo','Interpreter','Latex','Fontsize',18,'LabelHorizontalAlignment','right')
le=legend('FC, $\tilde\tau=0$','FC+SO, $\tilde\tau=0$','FC+SO+CE, $\tilde\tau=0$','FC+SO+CE+AD, $\tilde\tau=0$');
set(le,'Interpreter','Latex','Fontsize',16,'Location','southwest');
xlabel('$\vartheta+\tau$, \%','Fontsize',18,'Interpreter','Latex')
ylabel('Consumption gains, ƒin \% dev. from  status quo','Fontsize',18,'Interpreter','Latex')
grid on
str1="/figures/figure_wefare_decomp_1.pdf";
str_save1=append(root,str1);
settt
print(gcf,'-dpdf',str_save1)


%%
[mm,index_max_coun]=max(W_mat(1,:,6));

figure(103)
plot(100*(1-k_vec),100/cons_ss*(W_mat(1,1:length(k_vec),6))-100*1/cons_ss*W_mat(1,1,6),'--r','Linewidth',6),hold on
plot(100*(1-k_vec),100/cons_ss*(W_mat(1,1:length(k_vec),4))-100*1/cons_ss*W_mat(1,1,4),'-b','Linewidth',6),hold off
%vline(100*(1-k_vec(index_max_base)),':b','Optimal Subsidy')
%xline(100*(1-k_vec(index_max_base)),':b','Max at $r_c=r$','LineWidth',2,'FontSize',18,'Interpreter','Latex','LabelVerticalAlignment','bottom')
%xline(100*(1-k_vec(index_max_coun)),':r','Max at $r_c<r$','LineWidth',2,'FontSize',18,'Interpreter','Latex','LabelVerticalAlignment','bottom')
%yline(0,':k','LineWidth',2)
%axis([0 40 -1.5 1.25])
le=legend('$\tilde\tau=0$, $r_c=r$','$\tilde\tau=0$, $r_c<r$');
set(le,'Interpreter','Latex','Fontsize',16,'Location','northwest');
xlabel('$\vartheta+\tau$, \%','Fontsize',18,'Interpreter','Latex')
ylabel('Consumption gains, in \% dev. from  status quo','Fontsize',18,'Interpreter','Latex')
grid on
str1="/figures/figure_wefare_decomp_4.pdf";
str_save1=append(root,str1);
settt
print(gcf,'-dpdf',str_save1)


figure(105)
plot(100*tau_vec,100/cons_ss*(W_mat(:,index_max_base,6))-100*1/cons_ss*W_mat(1,1,6),'--r','Linewidth',6),hold on
plot(100*tau_vec,100/cons_ss*(W_mat(:,index_max_base,4))-100*1/cons_ss*W_mat(1,1,4),'-b','Linewidth',6),hold off
%xline(0,':b','Optimal','LineWidth',2)
%xline(25,':r','ISS','LineWidth',2)
yline(0,'--k','Status quo','Interpreter','Latex','Fontsize',18,'LabelHorizontalAlignment','left')
%axis([0 100 -2 1])
le=legend('$\vartheta+\tau=0.35$, $r_c=r$','$\vartheta+\tau=0.35$, $r_c<r$');
set(le,'Interpreter','Latex','Fontsize',16,'Location','southwest');
xlabel('$\tilde\tau$, \%','Fontsize',18,'Interpreter','Latex')
ylabel('Consumption gains, in \% dev. from  status quo','Fontsize',18,'Interpreter','Latex')
grid on
str1="/figures/figure_wefare_decomp_5.pdf";
str_save1=append(root,str1);
settt
print(gcf,'-dpdf',str_save1)

